<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>业主信息</title>


    <link rel="stylesheet" href="/static/webjars/layui/css/layui.css"  media="all">


    <script type="application/javascript" src="/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=cOtTydbKqZG2r1XaH49gtl34hKQ3VczY"></script>

    <style type="text/css">
        .anchorBL{
            display:none;
        }
    </style>
</head>
<body>

<div id="detail" style="width: 100%;">
    <form class="layui-form" action="" style="margin-top: 20px;" lay-filter="Proprietor">
        <div class="layui-collapse" lay-filter="test">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">业主信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table">
                        <tr>
                            <td width="10%" >代表人/业主</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="name"  placeholder="请输入业主姓名" class="layui-input" disabled="">
                                </div>
                            </td >
                            <td width="10%">业主联系电话</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="tellphone"  placeholder="请输入业主联系电话" class="layui-input" disabled="">
                                </div>
                            </td >
                            <td width="10%">业主身份证号码</td>
                            <td >
                                <div class="layui-inline">
                                    <input type="text" name="idCard"  placeholder="业主身份证号码" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">房屋产权信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table">
                        <tr>
                            <td width="10%">房屋编号</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="houseNum"  placeholder="请输入房屋编号" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">房产证号</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="cardNum"  placeholder="请输入房产证号" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">房屋凭证</td>
                            <td>
                                <div class="layui-input-inline">
                                    <input type="text" name="houseCoucher" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                        <tr>

                            <td>房屋权证号</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text" name="houseWarrant"  placeholder="请输入房屋产权证号" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td>房屋权证发放时间</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text"  name="time" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td>住房地址</td>
                            <td >
                                <div class="layui-inline-block">
                                    <input type="text" name="address"  placeholder="请输入地址" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">房屋信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table">
                        <tr>
                            <td width="10%">建筑物名称</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="buildName"  placeholder="请输入建筑物名称" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">建成年份</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="buildTime"  placeholder="请输入建成年份" class="layui-input" disabled="">
                                </div>
                            </td>

                            <td width="10%">建筑物用途</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text" name="buildUse" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="10%">物管单位名称</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="tubeUnit" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">本户建筑面积</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="area"  autocomplete="off" placeholder="请输入建筑面积" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">房屋结构</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text"  name="structure"  class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>

                        <tr>
                            <td width="10%">房屋用途</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text"  name="houseUse"  class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">房屋来源</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text"  name="houseFrom"  class="layui-input" disabled="">
                                </div>
                            </td>
                            <td>房屋户型</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text"  name="huxing"  class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">土地信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table">
                        <tr>
                            <td width="10%">土地取得方式</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text"  name="landGet"  class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">批准土地面积</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="langArea" placeholder="批准土地面积" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">实际使用土地面积</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text" name="landUsearea" placeholder="请输入实际使用土地面积" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="10%">批准土地用途</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landPurpose" placeholder="请输入土地用途" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">实际土地用途</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landUsepurpose" placeholder="请输入实际土地用途" class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">批准使用年限</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text" name="landYear" placeholder="请输入使用年限" class="layui-input" disabled="">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="10%">土地证号</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landNum" placeholder="请输入土地证号" class="layui-input" disabled>
                                </div>
                            </td>
                            <td width="10%">土地凭证</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landCoucher"  class="layui-input" disabled>
                                </div>
                            </td>
                            <td width="10%">土地权证号</td>
                            <td>
                                <div class="layui-inline">
                                    <input  type="text" name="landWarrant" class="layui-input" disabled>
                                </div>
                            </td>

                        </tr>
                        <tr>
                            <td width="10%">土地权证发证时间</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landTime"   class="layui-input" disabled="">
                                </div>
                            </td>
                            <td width="10%">产权人类型</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landTopr" class="layui-input" disabled>
                                </div>
                            </td>
                            <td width="10%">产权人姓名</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text" name="landUname"class="layui-input" disabled>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td width="10%">产权人证件类型</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landIdtype"class="layui-input" disabled>
                                </div>
                            </td>
                            <td width="10%">产权人证件号码</td>
                            <td width="15%">
                                <div class="layui-inline">
                                    <input type="text" name="landIdCard"  class="layui-input" disabled>
                                </div>
                            </td>
                            <td width="10%">产权人联系电话</td>
                            <td>
                                <div class="layui-inline">
                                    <input type="text"  name="landTel"  placeholder="请输入产权人联系电话" class="layui-input" disabled>
                                </div>
                            </td>
                        </tr>


                    </table>
                </div>
            </div>
            <div style="width: 100%;text-align: center">
                <div class="layui-btn-group demoTable" style="width: 20%;margin-bottom: 20px">
                    <div style="float: left">
                        <button class="layui-btn layui-btn-fluid " type='button' lay-even="pass" id="pass"  >批准</button>
                    </div>
                    <div style="float: right">
                        <button class="layui-btn layui-btn-primary" type='button' lay-even="refuse" id="refuse" >拒绝</button>
                    </div>
                </div>
            </div>
        </div>
    </form>


</div>



<script type="application/javascript" src="/static/webjars/layui/layui.js"></script>
<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作


    layui.use(['element','table','form'], function(){
        var element = layui.element;
        //…
        var table = layui.table;
        var form = layui.form;
        var $ = layui.$;
        var Id = GetRequest();

        var active = {
            pass: function(){ //获取选中数据
                $.post("/ajax/save/houseinfo-status",{
                    id: Id
                },function(result){
                    if(result.res === "1"){
                        console.log(result)
                    }
                });
            }
            ,refuse: function(){ //获取选中数目
                $.post("/ajax/save/houseinfo-deny",{
                    id:GetRequest()
                },function(result){
                    if(result.res === "1"){
                        console.log(result)
                    }
                });
            }

        };


        $.ajax({ //jquery跳转传输数据
            type : "POST",
            url : "/ajax/searchHouseInfo/searchHouseDetail",//跳转的controller
            dataType : "json",//返回类型
            contentType : "application/x-www-form-urlencoded; charset=utf-8",
            data : {//传输controller的键值对
                "id" : GetRequest()
            },
            success : function(house) {//成功后执行并取值

                form.val('Proprietor', {
                    "name": house.data.name  // "name": "value"
                    ,"idCard": house.data.idCard
                    ,"houseNum": house.data.houseNum
                    ,"cardNum": house.data.cardNum
                    ,"houseWarrant": house.data.houseWarrant
                    ,"address": house.data.province+house.data.city+house.data.county+house.data.town+house.data.village+house.data.address
                    ,"buildName": house.data.buildName
                    ,"buildTime": house.data.buildTime
                    ,"buildUse": house.data.buildUse
                    ,"tubeUnit": house.data.tubeUnit
                    ,"area": house.data.area+"㎡"
                    ,"structure": house.data.structure
                    ,"houseUse": house.data.houseUse
                    ,"houseFrom": house.data.houseFrom
                    ,"huxing": house.data.huxing
                    ,"landGet": house.data.landGet
                    ,"langArea": house.data.langArea+"㎡"
                    ,"landUsearea": house.data.landUsearea+"㎡"
                    ,"landPurpose": house.data.landPurpose
                    ,"landUsepurpose": house.data.landUsepurpose
                    ,"landYear": house.data.landYear
                    ,"landNum": house.data.landNum
                    ,"landCoucher": house.data.landCoucher
                    ,"landWarrant": house.data.landWarrant
                    ,"landTime": house.data.landTime
                    ,"landTopr": house.data.landTopr
                    ,"landUname": house.data.landUname
                    ,"landIdtype": house.data.landIdtype
                    ,"landIdCard": house.data.landIdCard
                    ,"tellphone": house.data.tellphone
                    ,"landTel": house.data.landTel
                    ,"houseCoucher": house.data.houseCoucher
                    ,"time": house.data.time
                })


            },
            error : function(request) {//失败后执行
                layer.msg("数据加载失败");
            }
        });




        $('#pass').on('click', function(){
            $.post("/ajax/save/houseinfo-status",{
                id: Id
            },function(result){
                if(result.res === "1"){
                    layer.msg("审核已通过")
                }
            });
            return false
        });

        $('#refuse').on('click', function(){
            $.post("/ajax/save/houseinfo-deny",{
                id:GetRequest()
            },function(result){
                console.log(Id);
                if(result.res === "1"){
                    layer.msg("审核已拒绝")
                }
            });
            return false
        });


        function GetRequest() {
            var url = location.search; //获取url中"?"符后的字串
            if (url.indexOf("?") != -1) {    //判断是否有参数
                var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
                strs = str.split("=");   //用等号进行分隔 （因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔）
                return strs[1];          //直接弹出第一个参数 （如果有多个参数 还要进行循环的）
            }
        }
    });
</script>


</body>
</html>